/*
 * board_init.c
 *
 *  Created on: Sep 13, 2013
 *      Author: Ken Arok
 */

#include "config_board.h"

#if BOARD_2_1_USED

#include "board.h"
#include "gpio.h"


/** \brief Initialize CPU Port I/O.
 *
 */
static void port_init(void);

/* ------------------------------------------------------------------------------ */

void board_init(void)
{
	/* Initialize Port. */
	port_init();
}

/* ------------------------------------------------------------------------------- */

static void port_init(void)
{
	/* Initialize Port A. */
	PORTA = 0x08;
	DDRA = 0xFF;

	/* Initialize Port B. */
	PORTB = 0x29;
	DDRB = 0xF6;

	/* Initialize Port C. */
	PORTC = 0x0F;
	DDRC = 0xFF;

	/* Initialize Port D. */
	PORTD = 0x0C;
	DDRD = 0xFB;

	/* Initialize Port E. */
	PORTE = 0x0F;
	DDRE = 0xFE;

	/* Initialize Port F. */
	PORTF = 0x00;
	DDRF = 0xFF;

	/* Initialize Port G. */
	PORTG = 0x02;
	DDRG = 0xFF;
}

#endif /* BOARD_2_1_USED */
